package com.cloudkinto.vo.wr.trial;

import com.cloudkinto.common.utils.MathUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SurchargeFeeRes {
    @ApiModelProperty("费用是否匹配成功，主要判断重量段")
    private boolean match;
    private String itemName;

    private Double fee;

    public SurchargeFeeRes(String itemName, Double fee) {
        this.match = true;
        this.itemName = itemName;
        this.fee = fee;
    }

    public Double getFee() {
        if (fee == null) {
            return null;
        }
        return MathUtils.numberFormat(fee, 4);
    }
}
